<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="js/vue.js"></script>
    <style>
            #box ul{
                list-style: none;
                width: 60%;
                margin: auto;
                border: 1px solid black;
                padding: 10px;
            }
            #box ul li{
                display: flex;
                justify-content: space-around;
                margin-top: 10px;
                border-bottom: 1px dashed #cccccc;
            }
            #box ul li:last-child{
                border-bottom: none;
            }
            #box ul li img{
                width: 100px;
            }
            .all{
                width: 60%;
                margin: auto;
            }
        </style>
</head>
<body>
    <div id="box">
        {{ myName[0].toUpperCase() + myName.substr(1) }}
        {{ firstMetterUp() }}
        {{ firstMetterUp() }}
        {{ firstMetterUp() }}
        {{ firstMetterUp() }}
        {{ firstMetterUp() }}
        
        {{ firstMetterToUp }}
        {{ firstMetterToUp }}
        {{ firstMetterToUp }}
        {{ firstMetterToUp }}
        {{ firstMetterToUp }}
    </div>
    <script>
        //计算属性及watch监听属性
        const vm = new Vue({
            el:"#box",
            data:{
                myName:"liudehua"
            },
            methods:{
                firstMetterUp(){
                    console.log("方法执行了")
                    return this.myName[0].toUpperCase() + this.myName.substr(1)
                }
            },
            computed:{ // 
                firstMetterToUp(){
                    console.log("计算属性调用了");
                    
                    return this.myName[0].toUpperCase() + this.myName.substr(1)
                }
            }
        })

    </script>
</body>
</html>